<?php

    function foo($foo){
        static $x;
        $t=microtime(true);
        if($foo=='start'){
            $x=$t;
        };
        if ($foo=='end'){
            $b=$t;
            $re=$b-$x;
            echo "<h2> $re</h2>";
        };
    };
    foo('start');
?>

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">

    <title>Document</title>
</head>
<body>

<h2>今天天气不错</h2>
<h2>今天天气不错</h2>
<h2>今天天气不错</h2>
<h2>今天天气不错</h2>
<h2>今天天气不错</h2>
<h2>今天天气不错</h2>
<h2>今天天气不错</h2>
<h2>今天天气不错</h2>

<?php

foo('end');


?>
</body>
</html>

